<%-- 
    Document   : EditImageTourPack
    Created on : Nov 1, 2011, 11:44:00 PM
    Author     : Mr-aUgust
--%>

<%@page pageEncoding="UTF-8"%>
<%@ page language="java" import="javazoom.upload.*,java.util.*" %>
<%@ page session="true" import="java.util.Collection, DAL.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<%
String im="";
try{
    if (MultipartFormDataRequest.isMultipartFormData(request)) {
        MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
        UploadBean upBean=new UploadBean();
        upBean.setFolderstore(getServletContext().getRealPath("/") + "images\\tour");
        String todo = null;
        if (mrequest != null) todo = mrequest.getParameter("todo");
        if ( (todo != null) && (todo.equalsIgnoreCase("upload")) ) {
            Hashtable files = mrequest.getFiles();
            if ( (files != null) && (!files.isEmpty()) ) {
                UploadFile file = (UploadFile) files.get("editImages");
                if (file != null)
                    im="images/tour/"+file.getFileName();
                upBean.store(mrequest, "editImages");
                
            } else {
                out.println("<li>No uploaded files");
            }
        } else out.println("<BR> todo="+todo);
    }
}catch (Exception ex){}
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        
        <script type="text/javascript" src="../js2/jquery.min.js"></script>
        <script type="text/javascript" src="../js2/easyzoom.min.js"></script>     
        
        <style type="text/css">
            <!--
.style1 {color: #3366FF}
            -->
        </style>
        
        <style type="text/css">
            #easy_zoom{
            width:400px;
            height:280px;	
            border:5px solid #eee;
            background:#fff;
            color:#333;
            position:absolute;
            top:40px;
            left:150px;
            overflow:hidden;
            -moz-box-shadow:0 0 10px #777;
            -webkit-box-shadow:0 0 10px #777;
            box-shadow:0 0 10px #777;
            
            line-height:400px;
            text-align:center;
            }            
        </style>
        
    </head>
    <%
    String id="";
    String img="";
    if(session.getAttribute("id")!=null) {
        id=(String)session.getAttribute("id");
        img=(String)session.getAttribute("image");
        
    }
    %>
    
    <body>
        <center> 
            <form id="editImage" action="../Admin/management.jsp?page=EditImageTourPack" enctype="multipart/form-data" name="editimage" method="post">
               
                <table>
                    <tr><td><h2 class="style1">Edit Image for Tour Package </h2></td>
                        
                    </tr>
                    <tr>
                        <td><input name="editImages" type="file" id="editImages"/>  
                            <input type="hidden" name="todo" value="upload">
                            <input type="submit" name="Submit" value="Upload">
                        </td>
                    </tr>
                </table>
            </form>
            <form action="../ControllerEditTourP" id="sendEdit" method="post">
               
                <table>
                    <tr>
                        <td height="50px"></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <% if(im !="") {
                            %>
                            <a href="../<%=im%>" class="zoom" width="400px" height="400px">
                                <img src="../<%=im%>" width="100px" height="100px"/>
                            </a>
                            <input type="hidden" name="images" value="<%=im%>"/>
                            <input type="hidden" name="iid" value="<%=id%>"/>
                            <%
                            }
                            %>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><input name="Update" type="submit" value="Update"/></td>
                        
                    </tr>
                </table>
            </form>
            <a href="../Admin/management.jsp?page=ManageTourPackage">Back to home</a>
        </center>
    </body>
    <script type="text/javascript">	
jQuery(function($){
	
	$('a.zoom').easyZoom();

});

    </script>
</html>

